#include "SingleGrid.h"
#include "SudokuSolver.h"

SingleGrid::SingleGrid(void): m_nDigit(-1)
{
}

SingleGrid::~SingleGrid(void)
{
}

SingleGrid::SingleGrid(int digit): m_nDigit(digit)
{
	
}

int SingleGrid::SetCoord(int x, int y)
{
	m_nX = x;
	m_nY = y;
	return 0;
}

ostream &operator<<(ostream& os, const SingleGrid &sg)
{
	os << sg.m_nX << ' ' << sg.m_nY;
	return os;
}
bool SingleGrid::IsProb(int digit)
{
	return m_Table.IsProb(digit);
}

int SingleGrid::Achieve(int digit)
{
	m_nDigit = digit;
	m_Table.Clear();

	TypeTeamIndex::iterator p;
	for ( p = m_TeamIndex.begin(); p != m_TeamIndex.end(); ++p )
	{
		(m_pOwner->GetTeam(*p))->DropDigit(digit);
	}

	return 0;
}

int SingleGrid::DropDigit(int digit)
{
	return m_Table.DropDigit(digit);
}
